package com.ky.pro.java.fx.spring.entity;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

/**
 * @ClassName AnnoSchool
 * @Description School Bean by Annotation
 * @Date 2021/12/4 14:01
 * @Author kevin
 **/
@Component("anno-school-001")
public class AnnoSchool extends School implements InitializingBean {

    @Autowired
    @Qualifier("anno-klass-001")
    transient Klass annoKlass;

    @Autowired
    @Qualifier("klass001")
    transient Klass klass001;

    public AnnoSchool() {
        super();
        this.id = 11L;
        this.name = "School of Annotation";
    }


    @Override
    public void afterPropertiesSet() {
        addKlass(annoKlass);
        addKlass(klass001);
    }
}
